import uvicorn
from fastapi import FastAPI
from database.db_init import Base, engine
from router import Farm_Admin_router, User_Farm_router, Lessee_router, Farm_router, Plot_router, Meteorology_router, Soil_router, Machine_router, Farming_Operation_router, Task_Plot_router, Task_Machine_router, Plot_Crop_router, Planting_Plan_router, Variety_router, Sensor_router, AI_Model_router, System_Log_router, Server_Status_router, AI_Consultation_router, Weather_Data_Processing_router, Soil_Data_Processing_router, Machine_Data_Processing_router, Crop_Data_Processing_router, Remote_Sensing_Image_router

Base.metadata.create_all(bind=engine)
app = FastAPI()
app.include_router(Farm_Admin_router.router)
app.include_router(User_Farm_router.router)
app.include_router(Lessee_router.router)
app.include_router(Farm_router.router)
app.include_router(Plot_router.router)
app.include_router(Meteorology_router.router)
app.include_router(Soil_router.router)
app.include_router(Machine_router.router)
app.include_router(Farming_Operation_router.router)
app.include_router(Task_Plot_router.router)
app.include_router(Task_Machine_router.router)
app.include_router(Plot_Crop_router.router)
app.include_router(Planting_Plan_router.router)
app.include_router(Variety_router.router)
app.include_router(Sensor_router.router)
app.include_router(AI_Model_router.router)
app.include_router(System_Log_router.router)
app.include_router(Server_Status_router.router)
app.include_router(AI_Consultation_router.router)
app.include_router(Weather_Data_Processing_router.router)
app.include_router(Soil_Data_Processing_router.router)
app.include_router(Machine_Data_Processing_router.router)
app.include_router(Crop_Data_Processing_router.router)
app.include_router(Remote_Sensing_Image_router.router)


if __name__ == "__main__":
    uvicorn.run(app, host="0.0.0.0",port=8002)
